package by.exposit.service;

import by.exposit.dao.StatusDAO;
import by.exposit.domain.Status;
import org.dozer.DozerBeanMapperSingletonWrapper;
import org.dozer.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StatusServiceImpl implements StatusService {

    @Autowired
    private StatusDAO statusDAO;

    @Override
    public Status retrieveStatus(Long statusId) {
        Mapper mapper = DozerBeanMapperSingletonWrapper.getInstance();
        return mapper.map(statusDAO.findByID(statusId), Status.class);
    }
}
